def isrun(x):
    if (x % 100 == 0 and x % 400 == 0) or (x % 100 != 0 and x % 4 ==0):
        return 1
    return 0
a = int(input())
print(isrun(a))